Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support ipfs daemon --offline #936

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

BrianBelhumeur
Copy link

This is a fix for #790

When the IPFS daemon is running in offline mode, pinning should still be enabled in the extension.

This fix functions by replacing isIpfsOnline with isApiAvailable to allow pinning actions in the Tools menu and in-page context menu.

@ipfs ipfs deleted a comment from welcome bot Oct 23, 2020
This changes the meaning of  offlinePeerCount to be the state when
peerCount is 0, and adds explicit apiDownPeerCount equal -1 to indicate
state where extension is unable to read peerCount and has to assume API
is down.
This way webui is present in local repo, even when no p2p transfer can
happen to fetch it
@lidel
Copy link
Member

lidel commented Oct 23, 2020

Thank you @BrianBelhumeur! Your comments from #790 (comment) were really useful and prompted me to refactor a few things (added them to this PR):

  • a7793c7 added a way to differentiate between "api is down" and "there are no peers but api is up" states and switched codebase to work better in offline mode
  • 53ca68c detects offline mode and tries to precache webui into the store by prefetching it from public gateway, which partially unblocks import operations (they open in webui, and that final step fails right now)

@lidel lidel changed the title Fix/offline mode feat: support ipfs daemon --offline Oct 23, 2020
@BrianBelhumeur
Copy link
Author

@lidel Thanks for all the help! I looked through the commits you provided... makes sense. Looks like the online/offline issue affects several parts of the code.

Happy to park until there's a resolution to ipfs/ipfs-webui#853

@lidel lidel added the status/blocked/upstream-bug Blocked by upstream bugs label Jan 7, 2021
@boomshroom
Copy link

There appear to be quite a few conflicts to getting this merged. I'm not terribly familiar with Javascript, so how bad are these conflicts that we're looking at?

I'll just quickly mention that I'll often run IPFS with --offline purely out of paranoia and instead use it as a personal archive, so I'm fairly excited to see this issue resolved.

@lidel
Copy link
Member

lidel commented Apr 22, 2021

IIRC this is blocked by ipfs/ipfs-webui#853 (comment)
This PR is pretty stale, so when that webui issue is resolved we will most likely create a new PR here.

@lidel lidel marked this pull request as draft May 6, 2021 23:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status/blocked/upstream-bug Blocked by upstream bugs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants